﻿// <copyright file="ArmiesGM.cs" company="Gravity Age Studios">
// Code released under the MIT license (see License.txt).
// </copyright>
// <author>Vicente Cartas Espinel</author>
// <email>vicente.cartas@gmail.com</email>
namespace LightSwitchApplication
{
    using LightSwitchApplication.Export;
    using LightSwitchApplication.Import;

    public partial class ArmiesGM
    {
        #region Add/Edit Army

        partial void gridAddAndEditNew_Execute()
        {
            this.Application.ShowArmyAddEditGM(null);
        }

        partial void gridEditSelected_CanExecute(ref bool result)
        {
            result = this.Collection.SelectedItem != null;
        }

        partial void gridEditSelected_Execute()
        {
            this.Application.ShowArmyAddEditGM(this.Collection.SelectedItem.Id);
        }

        #endregion

        partial void ImportArmies_Execute()
        {
            ImporterHelper.ImportArmies(this.DataWorkspace, this.Collection);
        }

        partial void ImportLandUnits_Execute()
        {
            //new Importer<Army>().ImportLandUnits(this.Collection, this.DataWorkspace);
        }

        partial void ImportSeaUnits_Execute()
        {
            //new Importer<Army>().ImportSeaUnits(this.Collection, this.DataWorkspace);
        }

        partial void ExportArmies_Execute()
        {
            Exporter.ExportArmies(this.Collection);
        }

        partial void ExportLandUnits_Execute()
        {
            // Write your code here.
        }

        partial void ExportSeaUnits_Execute()
        {
            // Write your code here.
        }
    }
}
